import Vue from 'vue'
import Web from './Web.vue'
import router from './router/indexpc'
import VueResource from 'vue-resource';
import '@/css/reset.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);
Vue.use(VueResource);

// Vue.config.productionTip = false

//Vue auth setting
try {//but my be have not setuserinfo
  let userinfo = getUserInfo();
  if (userinfo) {
    let u = JSON.parse(userinfo);
    Vue.http.headers.common['Authorization'] = 'Bearer ' + u.auth;
  }
} catch (e) {
  console.warn('载入用户信息时候发生问题，无法创建授权连接')
  console.warn(e);
}

new Vue({
  el: '#app',
  router,
  template: '<Web/>',
  components: {Web}
})
